package com.neu.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.mapper.GoodsMapper;
import com.neu.mapper.GoodsTypeMapper;
import com.neu.po.Goods;
import com.neu.po.GoodsExample;
import com.neu.po.GoodsType;
import com.neu.po.GoodsTypeExample;
@Service
public class GoodsTypeServiceImpl implements GoodsTypeService {
	
	@Autowired
	private GoodsTypeMapper goodsTypeMapper;
	
	@Autowired
	private GoodsMapper goodsMapper;
	
	@Override
	public List<GoodsType> getAll() {
		GoodsTypeExample example = new GoodsTypeExample();
		return goodsTypeMapper.selectByExample(example);
	}
	@Override
	public List<Goods> getByid(int goodstypeid) {
		GoodsExample example = new GoodsExample();
		
		example.or().andGoodstypeEqualTo(goodstypeid);
		
		return goodsMapper.selectByExample(example);
	}

}
